package com.taru.university.mapper;

import com.taru.university.model.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Component("commentMapper")
public interface CommentMapper {
    /**
     * 查询评论
     * @param articleId
     * @return
     */
    List<Comment> queryCommentByArticleId(String articleId);

    /**
     * 插入评论
     * @param comment
     */
    void insertComment(Comment comment);

    /**
     * 删除评论
     * @param userId
     * @param articleId
     */
    void deleteComment(@Param("userId") String userId, @Param("articleId") String articleId);

}
